namespace Digitalmes.Common.Workflows;

/// <summary>
/// 流程步骤上下文对象。
/// </summary>
public sealed class WorkflowStepContext
{
    /// <summary>
    /// 触发事件。
    /// </summary>
    /// <param name="workflowEvent">事件</param>
    /// <returns></returns>
    public Task EmitEventAsync(WorkflowEvent workflowEvent)
    {
        return Task.CompletedTask;
    }

    public Task EmitEventAsync(string eventId, object? data = null)
    {
        return EmitEventAsync(new WorkflowEvent()
        {
            Id = eventId,
            Data = data,
        });
    }
}
